package com.mixsmart.commonweb.service.impl;

import java.util.HashMap;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.mixsmart.commonweb.bean.entity.TCOperateFlag;
import com.mixsmart.commonweb.dao.PKStringDao;
import com.mixsmart.commonweb.service.IRoleUrlResService;

/**
 * 操作标识符－－服务类
 * @author lmq
 * @version 1.0
 * @since JDK版本大于等于1.6
 * <p>2016年3月17日</p>
 */
@Service
public class OperateFlagService extends SortNumService<TCOperateFlag>{

	@Autowired
	private IRoleUrlResService roleUrlResServ;
	
	@Override
	public PKStringDao<TCOperateFlag> getDao() {
		return (PKStringDao<TCOperateFlag>) dao;
	}

	@Override
	@Transactional(propagation=Propagation.REQUIRED, readOnly=false)
	public boolean delete(String[] ids) {
		boolean is = false;
		HashMap<String, Object> params = new HashMap<String, Object>(1);
		params.put("ids", ids);
		logger.info("正在级联删除操作标识（按钮）...");
		getExecuteServ().executes("del_cascade_operate_flag", params);
		logger.info("级联删除操作标识（按钮）[成功]...");
		roleUrlResServ.deleteOpFlag(ids);
		is = true;
		return is;
	}
}
